package com.mall.user.mq;

import com.alibaba.fastjson.JSONObject;
import com.mall.utils.SendMessage;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;

/**
 * 消费
 *
 * @author ASUS
 * @date 2021/07/18
 */
@Component
public class Consume {

    @JmsListener(destination = "sunyue")
    public void listen(String message){
        System.out.println("收到消息:"+message);
        JSONObject parseObject = JSONObject.parseObject(message);
        SendMessage.sendMessage(parseObject.getString("tel"),parseObject.getString("yzm"),1);
    }

}
